import request from './request'
// 牧场新增
export const penAdd = (addPen) => {
  return request({
    url: '/pen/add',
    method: 'post',
    data: addPen,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 牧场列表
export const penList = (params) => {
  return request({
    url: '/pen/list',
    method: 'get',
    param: params,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

//  牧场详情
export const penDetail = (penId) => {
  return request({
    url: '/pen/detail',
    method: 'get',
    param: {
      penId
    },
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 修改牧场
export const penUpdate = (updatePen) => {
  return request({
    url: '/pen/update',
    method: 'post',
    data: updatePen,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 获取全部圈棚列表 （查询使用）
export const penPenList = (ranchId) => {
  return request({
    url: '/pen/penList',
    method: 'get',
    param: {
      ranchId
    },
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}
